/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tetrisgame;

import gameElements.Cell;
import gameElements.shapes.Field;
import gameElements.shapes.Shape;
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Alexandra
 */
public class Game extends Applet {

    public Field field = new Field();
    public Shape figure = new Shape();
    public void paint(Graphics g) {
        /*
         * g.setColor(Color.blue); 
         g.drawRect(50, 80, 150, 100); 
         g.setColor(Color.magenta); 
         g.fillRect(230, 80, 150, 100); 
         */
      
        /*
            figure.area[0][0]=1;figure.area[0][1]=1;figure.area[0][2]=0;figure.area[0][3]=0;
            figure.area[1][0]=0;figure.area[1][1]=1;figure.area[1][2]=1;figure.area[1][3]=0;
            figure.area[2][0]=0;figure.area[2][1]=0;figure.area[2][2]=0;figure.area[2][3]=0;
            figure.area[3][0]=0;figure.area[3][1]=0;figure.area[3][2]=0;figure.area[3][3]=0;
        */
        /*
         * 
         *  figure.area[0][0]=0;figure.area[0][1]=1;figure.area[0][2]=0;figure.area[0][3]=0;
            figure.area[1][0]=1;figure.area[1][1]=1;figure.area[1][2]=1;figure.area[1][3]=0;
            figure.area[2][0]=0;figure.area[2][1]=1;figure.area[2][2]=0;figure.area[2][3]=0;
            figure.area[3][0]=0;figure.area[3][1]=0;figure.area[3][2]=0;figure.area[3][3]=0;
        */
       /*
        *   figure.area[0][0]=0;figure.area[0][1]=1;figure.area[0][2]=0;figure.area[0][3]=0;
            figure.area[1][0]=1;figure.area[1][1]=1;figure.area[1][2]=1;figure.area[1][3]=0;
            figure.area[2][0]=0;figure.area[2][1]=0;figure.area[2][2]=0;figure.area[2][3]=0;
            figure.area[3][0]=0;figure.area[3][1]=0;figure.area[3][2]=0;figure.area[3][3]=0;
       */
        figure.area[0][0]=1;figure.area[0][1]=1;figure.area[0][2]=1;figure.area[0][3]=1;
        figure.area[1][0]=0;figure.area[1][1]=0;figure.area[1][2]=0;figure.area[1][3]=0;
        figure.area[2][0]=0;figure.area[2][1]=0;figure.area[2][2]=0;figure.area[2][3]=0;
        figure.area[3][0]=0;figure.area[3][1]=0;figure.area[3][2]=0;figure.area[3][3]=0;
     
        for (int x = 0; x < field.getDimensionx(); x++) {
            for (int y = 0; y < field.getDimensiony(); y++) {
           
                field.getFieldMatrix().get(x).get(y).ondraw(g);

                //g.drawString(""+y, y*10+100, x*10+100);


            }
        }
        figure.drawShape(g);
        figure.fall(g);

    }

    public void init() {
        // field = new Field();
    }
    // TODO overwrite start(), stop() and destroy() methods

    public void createField() {
    }
}
